<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    17-mag-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
     
    $(document).ready(function()
    {
	
    });

    //]]>
</script>
<div id="content">
    <div id="summary" class="events">
	<div class="head">
	    <h2>
		<?php echo $this->event_types[$this->data['event_type']]['event_type_name'];?>
	    </h2>
	</div>
	<div class="body">
	    <table cellspacing="0" class="table">
		<tbody>
		    <tr>
			<th>Titolo:</th>
			<td>
			    <strong>
				<?php echo $this->data['event_title'] ?>
			    </strong>
			</td>
		    </tr>
		</tbody>
	    </table>
	</div>
    </div>
    <form>
	<ul>
	    <li class="addnew section">
		<a class="button" href="/admin/eventi/tourbook/id/<?php echo $this->data['event_id'] ?>">
		    <img src="/images/admin/16x16/tourbook.png" />Tourbook
		</a>
	    </li>
	</ul>
    </form>
   
	<table class="log clearfix list">
        <caption>
           Elenco Live
        </caption>
        <tbody id="live-list">
            <?php if( count( $this->live_list ) > 0 ) :
                foreach( $this->live_list as $live ): 
                    list( $y, $m, $d ) = explode( '-', $live['live_date'] );
                    ?>
                    <tr>
                        <td class="date">
                            <h3>
                                <b><?php echo $d ?> <?php echo $this->months[sprintf( '%01d', $m )] ?> <?php echo $y ?>, <span><?php echo $live['live_stagetime_ita'] ?></span></b>
                                <?php echo $this->days[date( 'N', mktime( $hour, $minute, $second, $m, $d, $y ) )] ?>
                            </h3>		
                        </td>
                        <td class="artists">
                        <?php 
                        $main_artists = null;
                        $openingact_artists = null;
                        if( count( $live['artists']['main'] ) > 0 ):
                            foreach( $live['artists']['main'] as $artist ):  
                                $main_artists .= $artist['artist_name'] .', ';
                            endforeach;
                        endif; ?>

                        <strong><?php echo substr( $main_artists, 0, -2 ) ?></strong>
                        <?php 
                        if( count( $live['artists']['openingact'] ) > 0 ):
                            foreach( $live['artists']['openingact'] as $artist ):  
                                $openingact_artists .= $artist['artist_name'] .', ';
                            endforeach; 
                        ?>
                        <br/> 
                        + <span><?php echo substr( $openingact_artists, 0, -2 ) ?></span>
                        <?php endif; ?>
                        </td>
                        <td class="location">
                            <?php echo $live['location']['location_name'] ?>, <strong><?php echo $live['location']['location_city'] ?></strong> (<?php echo $this->province[$live['location']['location_province_id']]['province_short_name'] ?>)
                        </td>
                        <td class="live-status">
                            <div class="live-status editable">
                                <div class="live-actions" id="<?php echo $live['live_id'] ?>">
                                    <span class="<?php echo $this->live_status[$live['live_status_id']]['live_status_mark'] ?>"><?php echo $this->live_status[$live['live_status_id']]['live_status_name'] ?></span>
                                </div>
                            </div>
                        </td>
                        <td title="Operazioni" class="actions">
                            <span>
                                <a class="view" href="/admin/live/vedi/id/<?php echo $live['live_id']?>">Dett.</a>
                                <a class="edit" href="/admin/live/artisti/id/<?php echo $live['live_id']?>">Edit</a>
                            </span>
                        </td>
                    </tr>
                <?php endforeach;
            else:
                ?><tr class="result"><td colspan="5">Nessun elemento presente...</td></tr> <?php	
            endif;?>
        </tbody>
    </table>
    <br class="clear"/>
    <form class="fab">
        <ul>
            <li class="section">
                <h3>Cosa vuoi fare ora?</h3>
            </li>
            <li class="addnew center">
                <a id="" class="button" href="/admin/contatti/vedi/id/<?php echo $this->data['contact_id'] ?>">
                    <img src="/images/admin/16x16/view.png" />Vedi Evento
                </a>
                <a id="" class="button" href="/admin/eventi/info/id/<?php echo $this->data['event_id'] ?>">
                    <img src="/images/admin/16x16/edit.png" />Modifica Evento
                </a>
                <a id="" class="button" href="/admin/eventi/live/id/<?php echo $this->data['event_id'] ?>">
                    <img src="/images/admin/16x16/add-new.png" />Aggiungi nuovo Live alla Rassegna
                </a>
                <a id="new" class="button" href="/admin/eventi/info">
                    <img src="/images/admin/16x16/add-new.png" />Aggiungi Nuovo Evento
                </a>
                <a id="" class="button" href="/admin/eventi">
                    <img src="/images/admin/16x16/events.png" />Torna a Elenco
                </a>
            </li>
        </ul>
    </form>    
</div>